package com.example.shiro02.utils;

import org.apache.shiro.authz.AuthorizationException;
import org.apache.tomcat.util.http.parser.Authorization;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;

/**
 * @Version 1.0
 * @Author:zlf
 * @Date:2020/11/25 - 13:06
 * @Content:全局异常处理
 */

@ControllerAdvice
public class GlobleExceptionHandler {
    @ExceptionHandler
    public  String doException(Exception e){
        if(e instanceof AuthorizationException){
            return "lesspermission";
        }
        return null;
    }
}
